import Tools from '@untils/tools.jsx';
// 活动类型
const activityType = Tools.getStorage('session', 'activityType');
// 所属党支部
const partyBranch = Tools.getStorage('session', 'partyBranch');
// 会议类型
const meetingType = Tools.getStorage('session', 'meetingType');
// 季节
const quarters = ['第一季度', '第二季度', '第三季度', '第四季度'];
// 年度
const years = Array.from({length: 20}).map((item, index) => (new Date()).getFullYear() - index);
// 性别
const sex = Tools.getStorage('session', 'sex');
// 学历
const qualification = Tools.getStorage('session', 'qualification');
// 婚姻
const marriageState = Tools.getStorage('session', 'marriageState');
// 转正状态
const passState = Tools.getStorage('session', 'passState');
// 民族
const nation = Tools.getStorage('session', 'nation');
// 缴纳类型
const payType = Tools.getStorage('session', 'payType');
//致贫原因
const poorReason = Tools.getStorage('session', 'poorReason');
// 扶贫进度
const helpProgress = Tools.getStorage('session', 'helpProgress');
//政治面貌
const polityState = Tools.getStorage('session', 'polityState');
//志愿活动类型
const voluntaryActivityType = Tools.getStorage('session', 'voluntaryActivityType');
// 正则
const REG = {
    idCard: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
    phone: /^[1]([3-9])[0-9]{9}$/,
    num: /^(0|[1-9][0-9]*)(\.[0-9]*)?$/
};
// 首页左右tab 列表页头部导航
const Links = [
    {
        name: '党员信息',
        icon: 'parter-msg-cion',
        path: '/layout/partymanage'
    }, {
        name: '党员缴费',
        icon: 'parter-pay-icon',
        path: '/layout/partypay'
    }, {
        name: '绩效考评',
        icon: 'check-icon',
        path: '/layout/partycheck'
    }, {
        name: '组织活动',
        icon: 'active-icon',
        path: '/layout/partyactive'
    }, {
        name: '两学一做',
        icon: 'learn-icon',
        path: '/layout/partylearn'
    }, {
        name: '三会一课',
        icon: 'meet-icon',
        path: '/layout/partymeet'
    }, {
        name: '志愿者管理',
        icon: 'vol-icon',
        path: '/layout/volmanage'
    }, {
        name: '精准扶贫',
        icon: 'heart-icon',
        path: '/layout/partyheart'
    }, {
        name: '帮扶管理',
        icon: 'help-icon',
        path: '/layout/helpmanage'
    }, {
        name: '党建风采',
        icon: 'graceful-icon',
        path: '/layout/partygraceful'
    }, {
        name: '工作链接',
        icon: ' work-icon',
        path: '/layout/worklink'
    }, {
        name: '系统管理',
        icon: 'manage-icon',
        path: '/layout/systemmanage'
    }
];

// 党员信息列表页 头部查询条件
const parterManageFilters = [
    {
        name: 'name',
        type: 'input',
        label: '党员姓名',
        placeholder: '请输入您的姓名'
    }, {
        name: 'phone',
        type: 'input',
        label: '手机号码',
        placeholder: '请输入您的手机号码'
    }];

// 党员缴费列表页 头部查询条件
const parterPayFilters = [
    {
        name: 'name',
        type: 'input',
        label: '党员姓名',
        placeholder: '请输入您的姓名'
    }, {
        name: 'phone',
        type: 'input',
        label: '手机号码',
        placeholder: '请输入您的手机号码'
    }];

// 绩效考评列表页 头部查询条件
const parterCheckFilters = [
    {
        name: 'name',
        type: 'input',
        label: '党员姓名',
        placeholder: '请输入您的姓名'
    }, {
        name: 'phone',
        type: 'input',
        label: '手机号码',
        placeholder: '请输入您的手机号码'
    }
];

// 组织活动列表页 头部查询条件
const activeFilters = [
    {
        name: 'topic',
        type: 'input',
        label: '活动主题',
        placeholder: '请输入活动主题'
    }, {
        name: 'time',
        type: 'time',
        label: '活动时间',
        placeholder: '请选择活动时间'
    }
];

// 两学一坐列表页 头部查询条件
const learnFilters = [
    {
        name: 'topic',
        type: 'input',
        label: '学习主题',
        placeholder: '请输入学习主题'
    }, {
        name: 'time',
        type: 'time',
        label: '学习时间',
        placeholder: '请选择学习时间'
    }
];

// 三会一课列表页 头部查询条件
const meetFilters = [
    {
        name: 'topic',
        type: 'input',
        label: '会议主题',
        placeholder: '请输入学习主题'
    }, {
        name: 'time',
        type: 'time',
        label: '会议时间',
        placeholder: '请选择会议时间'
    }
];

// 志愿者管理列表页 头部查询条件
const volManageFilters = [
    {
        name: 'name',
        type: 'input',
        label: '志愿者姓名',
        placeholder: '请输入志愿者姓名'
    },
    {
        name: 'duration',
        type: 'input',
        label: '服务时长',
        placeholder: '请输入',
        // rules: [{pattern: RegExp(REG.num, 'g'), message: '服务时长输入有误！'}]
    }
];

// 扶贫对象列表页 头部查询条件
const helpPoorFilters = [
    {
        name: 'poorName',
        type: 'input',
        label: '户主姓名',
        placeholder: '请输入户主姓名'
    }, {
        name: 'poorReason',
        type: 'select',
        label: '致贫原因',
        options: poorReason,
        placeholder: '请选择'
    }
];

// 扶贫管理列表页 头部查询条件
const helpCadreFilters = [
    {
        name: 'cadreName',
        type: 'input',
        label: '帮扶干部姓名',
        placeholder: '请输入干部姓名'
    }, {
        name: 'cadrePhone',
        type: 'input',
        label: '联系电话',
        placeholder: '请选择联系电话'
    }
];


// 扶贫管理列表页 头部查询条件
const helpManageFilters = [
    {
        name: 'cadreName',
        type: 'input',
        label: '帮扶主体',
        placeholder: '请输入'
    }, {
        name: 'poorName',
        type: 'input',
        label: '帮扶对象',
        placeholder: '请输入'
    }
];

// 工作链接列表页 头部查询条件
const workLinkFilters = [
    {
        name: 'title',
        type: 'input',
        label: '标题',
        placeholder: '请输入标题'
    }
];


export {
    // 首页左右导航
    Links,
    // 个页面头部搜素条件
    parterManageFilters,
    parterPayFilters,
    parterCheckFilters,
    activeFilters,
    learnFilters,
    meetFilters,
    volManageFilters,
    helpManageFilters,
    helpPoorFilters,
    helpCadreFilters,
    workLinkFilters,
    // 下拉选择项
    poorReason,
    helpProgress,
    payType,
    activityType,
    partyBranch,
    meetingType,
    quarters,
    years,
    sex,
    qualification,
    marriageState,
    passState,
    nation,
    polityState,
    voluntaryActivityType,
    // 正则
    REG,
};